﻿
namespace FacebookXmpp.Parse
{
	internal class XmlProcessingElement : XmlParseState
	{
		public XmlProcessingElement( XmlParseState xmlStartElement )
			: base( xmlStartElement )
		{}

		public override XmlParseState Parse(StringParser parser)
		{
            if (parser.PauseIfNearEnd(5))
                return this;

			parser.Consume( "<?" );
			if (parser.Find( "?>" ) == -1)
				return null;

			parser.ConsumeTo( parser.Find( "?>" ) );
			parser.Consume( "?>" );
			return new XmlStartElement( this );
		}
	}
}